<template>
	<view></view>
</template>

<script>
export default {
	data() {
		return {};
	},
	methods: {
		data: {
			id: 'chatcmpl-AY7B8djVAPMJlqoiyjfrGqpSck5rG',
			object: 'chat.completion.chunk',
			created: 1732694110,
			model: 'gpt-4o-mini-2024-07-18',
			system_fingerprint: 'fp_04751d0b65',
			choices: [{ index: 0, delta: { role: 'assistant', content: '' }, logprobs: null, finish_reason: null }]
		},
		data: {
			id: 'chatcmpl-AY7B8djVAPMJlqoiyjfrGqpSck5rG',
			object: 'chat.completion.chunk',
			created: 1732694110,
			model: 'gpt-4o-mini-2024-07-18',
			system_fingerprint: 'fp_04751d0b65',
			choices: [{ index: 0, delta: { content: '今晚' }, logprobs: null, finish_reason: null }]
		}
	}
};

// try {
// const response = await chatWithAI(input);
// const aiResponse = response.choices[0].message.content; // 假设 API 返回包含这个结构
// this.aiTitle = '聊天室';
// // 添加系统回复消息
// setTimeout(() => {
// 	this.messages.push({
// 		type: 'bot',
// 		content: aiResponse
// 	});
// }, 1000); // 模拟延迟
// 调用 chatWithAI 并传入回调函数
// await chatWithAI(input, (message) => {
// 	this.messages.push({
// 		type: 'bot',
// 		content: message
// 	});
// 	// 这里可以实现逐字显示的效果
// 	this.$nextTick(() => {
// 		const messagesContainer = this.$refs.messagesContainer;
// 		messagesContainer.scrollTop = messagesContainer.scrollHeight; // 滚动到底部
// 	});
// });
// this.aiTitle = '聊天室';
// }
</script>

<style></style>
